
Imports System.Data.SqlClient

Namespace _2bMatesSite.BO
	''' <summary>
	''' Represents a favorite group
	''' </summary>
	Public Class FavoriteGroup
		Protected groupID As Integer
		Protected grp As Group

		Public Sub New(ByVal groupID As Integer)
			Me.groupID = groupID
			Me.grp = Nothing
		End Sub

		Public Sub New(ByVal dr As SqlDataReader)
			Me.grp = New Group(dr)
			Me.groupID = grp.ID
		End Sub

		Public Overloads Overrides Function GetHashCode() As Integer
			Return groupID
		End Function

		Public ReadOnly Property ID() As Integer
			Get
				Return groupID
			End Get
		End Property

		Public ReadOnly Property Group() As Group
			Get
				If grp = Nothing Then
					grp = Groups.GetGroupByID(groupID)
				End If
				Return grp
			End Get
		End Property
	End Class
End Namespace






